import request from '@/utils/request'

// 获取同住人列表
export function cohabitantList(checkInId) {
  return request({
    url: '/wechat/renter/cohabitant/list',
    method: 'get',
    params: {
      checkInId
    }
  })
}

// 获取同住人详情
export function cohabitantDetail(renterId) {
  return request({
    url: `/wechat/renter/detail/${renterId}`,
    method: 'get',
  })
}

// 添加同住人
export function addCohabitant(data) {
  return request({
    url: '/wechat/renter/cohabitant',
    method: 'post',
    data
  })
}

// 删除同住人
export function deleteCohabitant(renterId) {
  return request({
    url: `/wechat/renter/cohabitant/${renterId}`,
    method: 'delete',
  })
}

// 修改同住人
export function updateCohabitant(data) {
  return request({
    url: `/wechat/renter/cohabitant`,
    method: 'put',
    data
  })
}

// 人脸身份认证
export function faceVerify(data) {
  return request({
    url: `/wechat/renter/verify/${data.renterId}`,
    method: 'post',
    params: data
  })
}
